block: genhd: Add NULL check for kobject_create_and_add in genhd_device_init#964
block: genhd: Add NULL check for kobject_create_and_add in genhd_device_init#964blktests-ci[bot] wants to merge 2 commits into
Conversation
|
Upstream branch: 062871f |
199644a to
e6d9eb8
Compare
|
Upstream branch: 66affa3 |
e8654c0 to
352c9dd
Compare
e6d9eb8 to
7d8604f
Compare
|
Upstream branch: bade58e |
352c9dd to
76fc032
Compare
7d8604f to
4cc45a3
Compare
|
Upstream branch: 4edcdef |
76fc032 to
4be3481
Compare
4cc45a3 to
90ffd56
Compare
|
Upstream branch: dc59e4f |
4be3481 to
bd9c14b
Compare
90ffd56 to
d52f35a
Compare
|
Upstream branch: 87320be |
bd9c14b to
5615f6f
Compare
d52f35a to
a644c13
Compare
|
Upstream branch: 8cdeaa5 |
…ce_init The kobject_create_and_add() call in genhd_device_init() may return NULL if memory allocation fails, but the return value was not being checked. This could lead to NULL pointer dereferences in subsequent calls to sysfs_create_link() and sysfs_remove_link() which use block_depr. Add proper error checking and cleanup path to handle the case when kobject_create_and_add() fails. Fixes: 721da5c ("driver core: remove CONFIG_SYSFS_DEPRECATED and CONFIG_SYSFS_DEPRECATED_V2") Signed-off-by: Li Jun <lijun01@kylinos.cn>
5615f6f to
e8df0fb
Compare
a644c13 to
a2204c3
Compare
Pull request for series with
subject: block: genhd: Add NULL check for kobject_create_and_add in genhd_device_init
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1111616